import  request  from '@/utils/request'
import {defineStore} from 'pinia'
import {Category,ApiRes} from '@/types/data'
const useCategoryStore = defineStore('category',{
  state(){
   return {
    money:100,
    list:[] as Category[]
   }
  },
  actions:{
   async  getAllCategory(){
    const res = await request.get<ApiRes<Category[]>>('/home/category/head')
    console.log(res.data);
    this.list = res.data.result
    },
  }
})
export default useCategoryStore